//
//  BaseModel.h
//  GyyxQiBao
//
//  Created by wangcheng on 15/6/8.
//  Copyright (c) 2015年 gyyx. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <AvailabilityMacros.h>

#define AUTO_DISMISS 0.05

#define HUD_IMAGE_SUCCESS @"/HUD_success.png"
#define HUD_IMAGE_ERROR	@"/HUD_error.png"

typedef enum {
    //显示HUD的同时允许用户点击其他地方
    LKProgressHUDMaskTypeNone = 1,
    //不允许用户点击其他地方
    LKProgressHUDMaskTypeClear,
    //不允许用户点击其他地方,并且添加灰色覆盖背景
    LKProgressHUDMaskTypeBlack,
    //不允许用户点击其他地方,并且添加渐变覆盖背景
    LKProgressHUDMaskTypeGradient
} LKProgressHUDMaskType;



@interface LKProgressHUD : UIView

/**
 *  只显示菊花转圈，手动dismiss
 */
+ (void)show;

/**
 *  只显示菊花转圈，bing指定交互方式
 */
+ (void)showWithMaskType:(LKProgressHUDMaskType)maskType;

/**
 *  显示指定文字，手动dismiss
 *
 *  @param status 文字
 */
+ (void)showWithStatus:(NSString*)status;

/**
 *  显示指定文字,并指定交互方式,手动dismiss
 *
 *  @param status 文字
 */
+ (void)showWithStatus:(NSString*)status maskType:(LKProgressHUDMaskType)maskType;




/**
 *  显示成功，并根据内容长度自动延迟隐藏
 *
 *  @param string 显示的内容
 */
+ (void)showSuccessAutoDismissWithStatus:(NSString*)string;

+ (void)showSuccessWithStatus:(NSString *)string duration:(NSTimeInterval)duration;


/**
 *  显示失败，并根据内容长度自动延迟隐藏
 *
 *  @param string 显示的内容
 */
+ (void)showErrorAutoDismissWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString *)string duration:(NSTimeInterval)duration;

+ (void)setStatus:(NSString*)string;

/**
 *  手动直接dismiss
 */
+ (void)dismiss;

/**
 *  手动成功dismiss，指定成功文字
 *
 *  @param successString 成功文字
 */
+ (void)dismissWithSuccess:(NSString*)successString;

/**
 *  手动成功dismiss，指定成功文字，指定显示的时间
 *
 *  @param successString 成功文字
 */
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;


+ (void)dismissWithError:(NSString*)errorString;

+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;

+ (BOOL)isVisible;

+ (void)dismissWithError:(NSString *)errorString afterDelay:(NSTimeInterval)seconds dismissComplete:(void(^)(void))dismissComplete;

+ (void)dismissWithSuccess:(NSString *)successString afterDelay:(NSTimeInterval)seconds dismissComplete:(void(^)(void))dismissComplete;



@end
